from datetime import datetime


class LogEntity:
    def __init__(self, index, term, leader_id, log_info):
        self.index = index
        self.term = term
        self.leaderId = leader_id
        self.log_info = log_info
        self.creationTime = datetime.utcnow()

    def get_json(self):
        return {
            'index': self.index,
            'term': self.term,
            'leaderId': self.leaderId,
            'log_info': self.log_info
        }

    def get_index(self):
        return self.index
